<title>实施情况确认登记</title>
<div class="row">
	<div class="col-xs-12 greening_registration">
		<form class="form-horizontal registerform">
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="form-group">
				<div class="input-group col-sm-10 col-md-offset-1">
					<!-- 武汉市建设项目配套绿地实施情况确认表-->
					<table width="700" height="412" border="1" align="center">
						<caption align="top">
							<span class="STYLE2">武汉市建设项目配套绿地实施情况确认表</span> <br />
							编号：<?=$model['docket_no']?>
						</caption>
						<tr>
							<td width="62" rowspan="5">审核情况</td>
							<td width="124">建设单位</td>
							<td colspan="5"><?=$model['c_unit']?></td>
						</tr>
						<tr>
							<td>项目名称</td>
							<td colspan="5"><?=$model['p_name']?></td>
						</tr>
						<tr>
							<td>项目地址</td>
							<td width="66"><?=$model['p_address']?></td>
							<td width="63">园档案号</td>
							<td width="84"><?=$model['docket_no']?></td>
							<td width="118">净用地面积（M²）</td>
							<td width="130"><?=$model['jy_area']?></td>
						</tr>
						<tr>
							<td>应留绿地面积（M²）</td>
							<td><?=$model['sh_area']?></td>
							<!-- 审核面积 -->
							<td>应留公共绿地面积（M²）</td>
							<td><?=$model['shgy_area']?></td>
							<!-- 调用创建登记信息（审核公共面积） -->
							<td>绿地率指标（%）</td>
							<td><?=number_format(($model['sh_area']/$model['jy_area']*100),2)?></td>
							<!-- 应留绿地面积（M²）/净用地面积（M²） -->
						</tr>
						<tr>
							<td>规划预留绿地面积（M²）</td>
							<td><?=$model['ghylld_area']?></td>
							<td>规划预留公共绿地面积（M²）</td>
							<td><?=$model['ghylgyld_area']?></td>
							<td>规划绿地率（%）</td>
							<td><?=number_format(($model['ghylld_area']/$model['jy_area']*100),2)?></td>
							<!-- 规划预留绿地面积（M²）/净用地面积（M²） -->
						</tr>
						<tr>
							<td rowspan="3">实际完成情况</td>
							<td>绿化施工单位</td>
							<td><?=$model['lhsg_unit']?></td>
							<td>联系人</td>
							<td><?=$model['sgwd_linkman']?></td>
							<td>联系电话</td>
							<td><?=$model['sgdw_phone']?></td>
						</tr>
						<tr>
							<td>实留绿地面积（M²）</td>
							<td><input type="text" name="hx_slld_area" id="hx_slld_area" /></td>
							<td>实留公共绿地面积（M²）</td>
							<td><label> <input type="text" name="hx_slgyld_area"
									id="hx_slgyld_area" />
							</label></td>
							<td>实留绿地率（%）</td>
							<td id="hx_slld_area_li"></td>
							<!-- 实留绿地面积（M²）/净用地面积（M²） -->
						</tr>
						<tr>
							<td>绿地差额面积（M²）</td>
							<td id="hx_ldce_area"></td>
							<!-- 审核面积-实留绿地面积 -->
							<td>误差率</td>
							<td id="hx_ldce_area_li"></td>
							<!-- (审核面积-实留绿地面积)/审核面积 -->
							<td>竣工时间</td>
							<td><label> <input type="text" id="hx_jg_time" /> （选填）
							</label></td>
						</tr>
						<tr>
							<td colspan="7">建设单位确认意见：
								<p>&nbsp;</p>
								<p>联系人（签字）： 联系电话：<?=date('Y-m-d',time())?></p>
							</td>
						</tr>
						<tr>
							<td>备注</td>
							<td colspan="6"><textarea class="form-control" id="hx_qr_remark"
									style="min-height: 150px;" placeholder="备注信息"><?=$model['qr_remark']?></textarea></td>
						</tr>
					</table>


				</div>
			</div>
			<div class="space-4"></div>
			<div class="clearfix form-actions">
				<div class="col-md-offset-3 col-md-9">
					<button class="btn btn-info save" type="button" id="btnSubmit">
						<i class="ace-icon fa fa-check bigger-110"></i>确认
					</button>
					&nbsp; &nbsp;
					<button class="btn" type="button">
						<i class="ace-icon glyphicon glyphicon-remove bigger-110"></i>取消
					</button>
					&nbsp; &nbsp;
					<button class="btn btn-purple" type="button" onclick="print();">
						<i class="ace-icon glyphicon glyphicon-print bigger-110"></i> 打印
					</button>
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
var scripts = [null,null];
var $scope = $(".greening_registration");
$('.page-content-area').ace_ajax('loadScripts', scripts, function(){
	$("#hx_slld_area").change(function(){
		var slld_area = $("#hx_slld_area",$scope).val();
		var sh_area= "<?=$model['sh_area']?>";
		var jy_area='<?=$model['jy_area']?>';
		console.log("审核面积："+sh_area);
		console.log("实留绿地面积:"+slld_area);
		console.log(sh_area-slld_area);
		//hx_ldce_area=审核面积-实留绿地面积
		$("#hx_ldce_area").text((sh_area-slld_area).toFixed(2));
		//hx_ldce_area_li=(审核面积-实留绿地面积)/审核面积 
		if(sh_area>0){
			console.log((sh_area-slld_area)/sh_area);
			$("#hx_ldce_area_li").text(((sh_area-slld_area)/sh_area*100).toFixed(2));
		}
		$("#hx_slld_area_li").text((slld_area/jy_area*100).toFixed(2));
	});
	$("#btnSubmit",$scope).click(function(){
		var content = $("#hx_qr_remark",$scope).val();
		var slld_area = $("#hx_slld_area",$scope).val();
		var slgyld_area = $("#hx_slgyld_area",$scope).val();
		var jg_time = $("hx_jg_time",$scope).val();
		$.post('/greening/ajax_green_registration', {
			'id': '<?=$id?>',
			'content': content,
			'slld_area':slld_area,
			'slgyld_area':slgyld_area,
			'jg_time':jg_time
		}, function(data) {
			if (200 === data.status) {
				message_box.show(data.data);
				gDialog.fClose();
				if (typeof(pageObj) != "undefined") {
					if (data.page < pageObj.get_page_count()) {
						pageObj.dec_page_count(); //-1
						if (pageObj.get_page_index() > pageObj.get_page_count()) {
							pageObj.go_page(pageObj.get_page_count());
						} else {
							pageObj.cur_page();
						}
					} else {
						pageObj.cur_page();
					}
				}
			} else {
				message_box.show(data.data);
			}
		}, 'json');
	});
})
</script>
